/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ytl;

import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Point;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
 *
 * @author Franz
 */
public class Error {
    
    static JLabel Error_logo = new JLabel();
    static JFrame Error_Frame = new JFrame("Error !!");
    
    static AudioClip no;
    static Point pt = new Point();
    static Container contentPane = Error_Frame.getContentPane();
    
    public static void Init_Error(){
        pt = Main_Menu.frame.getLocation();
        Error_Frame.setLocation(pt.x + 280,pt.y + 140);
        Error_Frame.setSize(new Dimension(280, 130));
        Error_Frame.setResizable(false);

        Error_logo.setIcon(new javax.swing.ImageIcon("pictures/error/error_general.png"));
        
        contentPane.setBackground(Color.white);
        contentPane.add(Error_logo,BorderLayout.BEFORE_LINE_BEGINS);
        
        try {
            no = Applet.newAudioClip(new URL("file:pictures/no.wav")); 
        } catch (MalformedURLException ex) {
        }
        
        
    }
    public static void Error() {
       try {
           Init_Error();
           Error_Frame.setVisible(true);
           no.play();
           Thread.sleep(1000);
           Error_Frame.setVisible(false);
       } catch (InterruptedException e) {
       }
    }
    
    public void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                Error();
            }
        });
    }

}
